package com.ctcemti.mdm.project.sys.service;

import com.ctcemti.mdm.common.result.Result;
import com.ctcemti.mdm.project.sys.entity.OrgOrganization;
import com.ctcemti.mdm.project.sys.entity.OrgPerson;
import com.ctcemti.mdm.project.sys.entity.OrgRole;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.security.NoSuchAlgorithmException;
import java.util.List;
import java.util.Map;

/**
 * @ClassName InfDisciplinesMapper
 * @Description 专业领域逻辑层接口层
 * @Author bxf
 * @Date 11:20 2019/7/12
 * @Version V1.0
 **/

public interface IOrgPersonService {


    /**
     * @Author pzw
     * @Description 新增
     * @Date 11:39 2019/7/18
     * @Param
     * @return
     **/
    Result<OrgPerson> insert(OrgPerson orgPerson, MultipartFile file);

    /**
     * @Author pzw
     * @Description 分页查询
     * @Date 11:39 2019/7/18
     * @Param
     * @return
     **/
    List<OrgPerson> selectAllOrgPerson(OrgPerson orgPerson);

    /* *
     * @Author bxf
     * @Description 分页查询(排除已绑定角色的人员获取查查寻已绑定的人员)
     * @Date 17:09 2019/8/27
     * @param orgPerson
     * @param flag
     * @return java.util.List<com.ctcemti.mdm.project.sys.entity.OrgPerson>
     */
    List<OrgPerson> selectAllOrgPersonNoRoleOrHasRole(OrgPerson orgPerson, Integer flag) ;

    /**
     * @Author pzw
     * @Description 根据条件查询实体
     * @Date 11:39 2019/7/18
     * @Param
     * @return
     **/
    List<OrgPerson> selectOrgPerson(OrgPerson orgPerson);

    /**
     * @Author pzw
     * @Description 修改
     * @Date 11:39 2019/7/18
     * @Param
     * @return
     **/
    Result<OrgPerson> updateOrgPerson(OrgPerson orgPerson,MultipartFile file);

    /**
     * 删除
     * @param ids
     * @return
     */
    int deleteOrgPerson(String[] ids);

    /**
     * @Author pzw
     * @Description 登录名是否存在
     * @Date 11:39 2019/7/18
     * @Param
     * @return
     **/
    int hasOrgPerson(OrgPerson orgPerson);

    /**
     * @Author pzw
     * @Description 查询组织树
     * @Date 11:39 2019/7/18
     * @Param
     * @return
     **/
    List<OrgOrganization> selectOrgTree(OrgPerson orgPerson,String token);

    /**
     * @Author pzw
     * @Description 移动
     * @Date 11:39 2019/7/18
     * @Param
     * @return
     **/
    int moveOrgPerson(String[] ids, String[] orgids, Boolean retain);
    /**
     * @Author 导入
     * @Description 移动
     * @Date 11:39 2019/7/18
     * @Param
     * @return
     **/
    Map<String,Object> uploadFile(MultipartFile multipartFile, String orgId, HttpServletResponse response, HttpServletRequest request) throws IOException, NoSuchAlgorithmException;
    /* *
     * @Author bxf
     * @Description 登陆验证
     * @Date 22:38 2019/8/24
     * @param orgPerson
     * @return int
     */
    Result loginSystem(HttpServletRequest request,OrgPerson orgPerson) throws NoSuchAlgorithmException;

    /* *
     * @Author bxf
     * @Description 查询组织角色
     * @Date 11:31 2019/9/10
     * @param orgPerson
     * @return java.util.List<com.ctcemti.mdm.project.sys.entity.OrgRole>
     */
    List<OrgRole> selectOrgRole(OrgPerson orgPerson);
    /* *
     * @Author bxf
     * @Description 修改密码
     * @Date 11:31 2019/9/10
     * @param person
     * @param flag 更新验证标记（1位验证2为更新）
     * @return com.ctcemti.mdm.common.result.Result
     */
    int changePassWord(OrgPerson person,Integer flag);
    /* *
     * @Author bxf
     * @Description 根据ids获取人员信息
     * @Date 14:25 2019/11/19
     * @param ids
     * @return java.util.List<com.ctcemti.mdm.project.sys.entity.OrgPerson>
     */
    List<OrgPerson> selectOrgPersonByIds(String ids);
}